
import React from 'react'
import {createBrowserRouter} from 'react-router-dom'
 
const load = (Com)=><React.Suspense fallback={<div>Loading...</div>}><Com></Com></React.Suspense>
const router = createBrowserRouter([
    {
        path:'/',
        element: load(React.lazy(()=>import('../App'))),
        children:[
            {
                path:'',
                element: load(React.lazy(()=>import('../views/index/index')))
            },
            {
                path:'about',
                element: load(React.lazy(()=>import('../views/about/index')))
            },
        ]
    },
    {
        path:'/*',
        element: <div>404 NOt Found</div>
    },
])
export default router